import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('../layout/index.vue'),
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('../views/dashboard/index.vue'),
        meta: { title: '首页', icon: 'House' }
      },
      {
        path: 'employee',
        name: 'Employee',
        component: () => import('../views/employee/index.vue'),
        meta: { title: '员工管理', icon: 'User' }
      },
      {
        path: 'customer',
        name: 'Customer',
        component: () => import('../views/customer/index.vue'),
        meta: { title: '顾客管理', icon: 'UserFilled' }
      },
      {
        path: 'route',
        name: 'Route',
        component: () => import('../views/route/index.vue'),
        meta: { title: '线路管理', icon: 'Location' }
      },
      {
        path: 'contract',
        name: 'Contract', 
        component: () => import('../views/contract/index.vue'),
        meta: { title: '合同管理', icon: 'Document' }
      },
      {
        path: 'ledger',
        name: 'Ledger',
        component: () => import('../views/ledger/index.vue'),
        meta: { title: '账单统计', icon: 'Histogram' }
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 